package fr.cpe.dp.projet2.rmi.client;

import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import javax.swing.JComboBox;
import javax.swing.JFrame;

public class RmiClientMusicServiceView {
    private JComboBox listServices;
    
    public RmiClientMusicServiceView() {
        JFrame fenetre = new JFrame("Choix des services RMI");
        listServices = new JComboBox();
        fenetre.getContentPane().add(BorderLayout.CENTER, listServices);
        fenetre.setSize(500, 100);
        fenetre.setVisible(true);
    }
    
    public void addServiceToComboBox(Object item) {
        listServices.addItem(item);
    }
    
    public Object getSelectedService() {
        return listServices.getSelectedItem();
    }
    
    public void addListServicesListenner(ActionListener l) {
        listServices.addActionListener(l);
    }
    
    public void startIHM(JFrame ihm) {
        ihm.validate();
        ihm.repaint();
    }
}
